<?php
    A();

    function A()
    {
        $memcached = new Memcached();
        $memcached->addServer('localhost', 11211);
		$f=fopen("pop/pop_sorted.json","r");
        $array =  Array();
        fgets($f);
		while (!feof($f))
		{
			$l = fgets($f);
            if ($l[strlen($l) - 2] != ',')
            {
                array_push($array, $l);
                break;
            }
            else
            {
                $l = substr($l, 0, strlen($l)-2);
                array_push($array, $l);
            }
		}
        $memcached->set('pop_sorted', $array);
        print_r($array);
		fclose($f);
    }
?>
